﻿@using System.Collections.Generic;
@using Think.Lenovo.Com.Models;
@using Think.Lenovo.Com.Models.Users;
@using System.Web.Mvc.Html;
<link href="/Contents/css/skin.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Cache-Control" content="no" />
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #EEF2FB;
}
-->
</style>
<script type="text/javascript" src="/Scripts/lib/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="/Scripts/lib/SerializeObject.js"></script>
<script type="text/javascript" src="/Scripts/ViewManageRole.js"></script>

<body>
    <table>
        <tr>
            <td>
                角色编码
            </td>
            <td>
                <input type="text" id="Code" value="" maxlength="4" />
            </td>
            <td>
                角色名称
            </td>
            <td>
                <input type="text" id="Name" value="" maxlength="10" />
            </td>
            <td>
                排序序号
            </td>
            <td>
                <input type="text" id="Seq" maxlength="9" />
            </td>
            <td>
                <input type="button" name="" value="保存角色" onclick="SaveRole();" />
                <input type="hidden" id="roleId" value="undefined" />
                <input type="button" id="CancelEditBtn" value="取消修改" onclick="reset();" disabled="disabled" />
            </td>
        </tr>
    </table>
    <hr />
    <table id="userLevelList" style="table-layout: auto;" width="100%" cellpadding="0" cellspacing="0">
        <tr>
            <td align="center">
                <font color='green'>角色编码</font>
            </td>
            <td align="center">
                <font color='green'>角色名称</font>
            </td align="center">
            <td align="center">
                <font color='green'>排序序号</font>
            </td>
            <td align="center">
                <font color='green'>操作</font>
            </td>
        </tr>
        @{
            foreach (RoleModel item in (LinkedList<RoleModel>)ViewData["list"])
            {
            <tr>
                <td align="center">@item.Code
                </td>
                <td align="center">@item.Name
                </td>
                <td align="center">@item.Seq
                </td>
                <td align="center">
                    <a href="#" onclick="bindData(@item.Id);">修改</a> |
                    <a href="#" onclick="getUserLevel(@item.Id);">分配等级</a>
                </td>
            </tr>
            }
        }
    </table>

    <!-- 用户等级容器 -->
    <div id="userLevelContainer">
    </div>
    @*<input type="hidden" id="dataPool" value="" />*@
    <textarea id="dataPool" style="display:none"></textarea>
</body>
